
#ifndef   __FIRMWARE_UPDATE
#define   __FIRMWARE_UPDATE


#define	 INTERRUPT_VECTOR_SELECT			RE5	
#define	 INTERRUPT_VECTOR_SELECT_DIR		TRISE5
#define	 FIRST_HALF								0
#define	 SECOND_HALF							1



#define   PROGRAM_START__FIRST_HALF			0x400							
#define   PROGRAM_START__SECOND_HALF		0xFFF0							

#define   PROGRAM_SIZE	(PROGRAM_START__SECOND_HALF - PROGRAM_START__FIRST_HALF)	



/* test conditions */
#define FLASH 		EEPGD==1
#define EEPROM 	EEPGD==0
#define CONFIG 	CFGS==1

/* hex record types */
#define DATA 				0
#define END 				1
#define EXTEND_ADDRESS 	4


/* Bootloader states */
#define   BOOT_NORMAL								0 
#define   BOOT_FROM_MODEM							1
#define   BOOT_FROM_MODEM_HANDSHAKE				2
/* --- */


void Switch_Boot_Pointer( void );
unsigned char FirmwareUpdate ( void );

#endif
